package com.gaohe.official.service.impl;

import java.util.List;
import com.gaohe.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gaohe.official.mapper.FmCommunityMapper;
import com.gaohe.official.domain.FmCommunity;
import com.gaohe.official.service.IFmCommunityService;

/**
 * 论坛圈子Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-03
 */
@Service
public class FmCommunityServiceImpl implements IFmCommunityService 
{
    @Autowired
    private FmCommunityMapper fmCommunityMapper;

    /**
     * 查询论坛圈子
     * 
     * @param communityId 论坛圈子主键
     * @return 论坛圈子
     */
    @Override
    public FmCommunity selectFmCommunityByCommunityId(Long communityId)
    {
        return fmCommunityMapper.selectFmCommunityByCommunityId(communityId);
    }

    /**
     * 查询论坛圈子列表
     * 
     * @param fmCommunity 论坛圈子
     * @return 论坛圈子
     */
    @Override
    public List<FmCommunity> selectFmCommunityList(FmCommunity fmCommunity)
    {
        return fmCommunityMapper.selectFmCommunityList(fmCommunity);
    }

    /**
     * 新增论坛圈子
     * 
     * @param fmCommunity 论坛圈子
     * @return 结果
     */
    @Override
    public int insertFmCommunity(FmCommunity fmCommunity)
    {
        fmCommunity.setCreateTime(DateUtils.getNowDate());
        return fmCommunityMapper.insertFmCommunity(fmCommunity);
    }

    /**
     * 修改论坛圈子
     * 
     * @param fmCommunity 论坛圈子
     * @return 结果
     */
    @Override
    public int updateFmCommunity(FmCommunity fmCommunity)
    {
        fmCommunity.setUpdateTime(DateUtils.getNowDate());
        return fmCommunityMapper.updateFmCommunity(fmCommunity);
    }

    /**
     * 批量删除论坛圈子
     * 
     * @param communityIds 需要删除的论坛圈子主键
     * @return 结果
     */
    @Override
    public int deleteFmCommunityByCommunityIds(Long[] communityIds)
    {
        return fmCommunityMapper.deleteFmCommunityByCommunityIds(communityIds);
    }

    /**
     * 删除论坛圈子信息
     * 
     * @param communityId 论坛圈子主键
     * @return 结果
     */
    @Override
    public int deleteFmCommunityByCommunityId(Long communityId)
    {
        return fmCommunityMapper.deleteFmCommunityByCommunityId(communityId);
    }
}
